﻿@model YQBlog.Models.AlbumModel
@using res = Resource.Views.Home.Home;
@{YQBlog.General.GeneralConfigInfo ci = ViewBag.CI as YQBlog.General.GeneralConfigInfo;} 

<div class="web_path">@res.Path：@Html.ActionLink(res.HomePage, "Index", "Home") \ @Html.Raw(Model.AlbumPath)</div>
<div class="page_wrap">
    <div class="album_view">
        <h3 class="album_title">@Model.Title</h3>
        <div class="album_time">@Html.GetTime(Model.Createdate) @res.View (@Model.ViewCount) 
        @if (Model.CommentCount > 0)
        {
        <a href="#comment">@res.Comment (@Model.CommentCount)</a> 
        }
        </div>
        <div class="album_summary">@Html.Raw(Model.Description)</div>
        <div class="album_content">
            <div id="gallery" class="ad-gallery">
                <ul class="ad-thumb-list">
                @foreach (var item in Model.ImageList)
                {
                    string imgsrc = item.Src;
                    //string imgpath = imgsrc.Remove(imgsrc.LastIndexOf("/"));
                    //string imgname = imgsrc.Remove(0, imgsrc.LastIndexOf("/") + 1);
                    //imgsrc = imgpath + "/300x300/" + imgname;
                    <li>
                    @item.Title
                    <br/>
                        <a href="@item.Src" target="_blank">
                        <img src="@(imgsrc)" title="@item.Title" alt="@item.Alt"/>
                        </a>
                    <br/>
                    </li>
                }
                </ul>
            </div>
        </div>
    </div>
    <div class="albumtool">
        <div class="digg albumdigg">
            <div class="digg_favor">@Model.Favor</div>
            <div class="digg_against">@Model.Against</div>
            <div class="digg_tip">@ViewBag.VoteTip</div>
        </div>
        <div class="prenextlink">@Html.Raw(ViewBag.PreNextLink)</div>
     </div>
    <a name="comment"></a>
    <h2>@res.CommentsList</h2> 
    @Html.Action("reply", "home", new { id = Model.Id })
</div>
<div id="sidebar">
    <div class="sidebar_sub">
    <h3>@res.NewAlbums</h3>
    <div>
    @foreach (var item in ViewBag.NewAlbums as IEnumerable<YQBlog.Models.AlbumModel>)
    {
        <div class="newalbum_box">
            <div class="album_cover"><a href="@Html.YQUrl(item)"><img src="@(item.Cover.Src)" alt="@item.Description"/></a></div>
            <p class="album_title">
                <a href="@Html.YQUrl(item)">@(item.Title) (@item.ImgCount)</a>
                @if (item.CommentCount > 0)
                {   
                <a title="Comment" href="@Html.YQUrl(item)#comments"> @(item.CommentCount) @res.Comments</a> 
                }  
            </p>
        </div>
    }
    </div>   
    </div>
</div>
@section Js{
<script type="text/javascript">
    var ArticleId = @ViewBag.ArticleId;
    $(function () {
        GetPageInfo();
        GetComment(1);
    });
</script> 
}